<!--Template for user profile-->

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>Profile - Comics.US</title>
<link rel="stylesheet" href="../template.css" type="text/css" />

</head>
<body>
<div id="outer_container">
  <div id="inner_container">
    <div id="header_wrapper">
	  
	  {% if logged_in %}   <!--If the user is logged in display username and ability to logout-->
      <div id="login">
		Welcome {{user}}&nbsp &nbsp
        <form id="form1" name="form1" method="post" action="accounts/logout">
           Not you?
		   <label> <a href="accounts/logout"> <!-- <laber> -->
		   <input type="submit" name="logout" id="button" value="Log Out" width="15px"/></a>
           </label>
        </form>
      </div>  
	  {% endif %}
	  
    </div>
    <div id="navigator_container">
    <!--Top links same for every page-->
      <div id="navigator"><a href="../home" id="gl1" class="glink"> Home  |   </a><a href="../list/comics/1" id="gl2" class="glink" onmouseover="ehandler(event,menuitem2);"> Comics  |   </a><a href="../list/fiction/1" id="gl3" class="glink" onmouseover="ehandler(event,menuitem3);"> Fictions  |   </a><a href="../list/gallery/1" id="gl4" class="glink" onmouseover="ehandler(event,menuitem3);"> Gallery  |   </a><a href="../list/clan/1" id="gl5" class="glink" onmouseover="ehandler(event,menuitem3);"> Clans  |   </a><a href="../list/people/1" id="gl7" class="glink" onmouseover="ehandler(event,menuitem3);"> People  |   </a> <a href="../profile/{{me}}" id="gl6" class="glink" onmouseover="ehandler(event,menuitem3);"> Profile </a></div>
      <div id="search_container">
        <form id="form2" name="form2" method="post" action="">
          <label>
            <input type="text" name="textfield3" id="textfield3" />
          </label>
                     <label>
            <input type="submit" name="button" id="button" value="Search" width="15px" />
          </label>
        </form>
      </div>
    </div>
    <div id="listing_header_container">
      <p>Breadcrumb (remain the same for all pages)</p>
    </div>
    <div id="doc2">
    <div id="main_area_profile">
      <div id="ranking_in_homepage">
        <div id="profile_picture">
         <p> <img src="../profile_pic/{{user}}.jpg" alt="{{user}}'s picture" style="height:100px"/></p>   <!--Display profile icture for specific user-->
		  {% if edit %}          <!--if this is the users own profile, they have the ability to edit it-->
          <form id="form3" name="form3" enctype="multipart/form-data" method="post" action="{{me}}/uploadprofilepic">
            <label>
              <input type="file" name="pic" id="pic" value="change_picture" />
              <input type="submit" name="picsubmit" id="picsubmit" value="Upload Picture" />        <!--Button to upload a profile picture-->        
            </label>
          </form>
		  {% endif %}
        </div>
        <div id="fiction_rank">
          <p>Name: {{user}}.<br>Member since {{date_joined}}.<br>Rating: {{rating}} </p>       <!--Display member info using varibales from accounts class-->
        </div>
		<div id="profile_info">
               {% if not edit%} <!-- Only other users can rate someone, you cannot rate yourself-->
			      <form id="form6" name="form6" method="post" action="rate/{{user}}">   <!--Radio buttons to rate the user on a 1-3 scale-->
                    <p>
                      <label>
                        Rate 
                        <input type="radio" name="rate" value="1" id="RadioGroup1_0" />
                        1</label>
                      <label>
                        <input type="radio" name="rate" value="2" id="RadioGroup1_1" />
                      2</label>
                      <label>
                        <input type="radio" name="rate" value="3" id="RadioGroup1_2" />
                      3</label>
                      <br />
					  <input type="submit" name="sumbit" value="Rate"/>
                    </p>
                  </form>
				{% endif %}
				
				{% if not edit%} <!-- Only other users can add a friend-->
<form id="form3" name="form3" method="post" action="add/{{user}}">                
              <label>
                <input type="submit" name="button2" id="button2" value="Add friend" />                  <!--Button to add a friend-->
                <br />
              </label>
                  </form>
				  {% endif %}
				  
				{% if not edit%}  <!-- Only other users can initiate a chat-->
          <form id="form15" name="form15" method="post" action="">
            <label>
              <input type="submit" name="button12" id="button12" value="Talk to him/her" />       <!--Button to initiate chat-->
            </label>
          </form>
		  {% endif %}
         
<!--Data that is displayed on sidebar-->
	 
	 </div>
        <div id="my_favorite">                         
          <div id="myfavcomics_banner"></div>
          <table width="190" border="1">
		  {% for f in myfavoritecomics %}    <!--Loop to display favorite comics in profile-->
            <tr>
    <td width="122"> <a href="{{f.title}}"> {{f.title}} </a> </td>
   {% if edit %} <td width="52">
	<form id="form5" name="form5" method="post" action="">
	
      <label>
        <input type="submit" name="button4" id="button4" value="Delete" />     <!--Button to delete favorite comic-->
      </label>
	
    </form></td>
	{% endif %}
  </tr>
    {% endfor %}
 
</table>



        </div>
        <div id="my_favorite">
          <div id="myfavfiction_banner"></div>
          <table width="190" border="1">
		  {% for f in myfavoritefiction %}    <!--Loop to display favorite fictions-->
            <tr>
              <td width="122"><a href="{{f.title}}"> {{f.title}}</td>
			  {% if edit %}
              <td width="52"><form id="form4" name="form4" method="post" action="">
                <label>
                  <input type="submit" name="button3" id="button3" value="Delete" />      <!--Button to delete favorite fiction-->
                </label>
              </form></td>
			  {% endif %}
            </tr>
			{% endfor %}
           
			
          </table>
        </div>
        <div id="my_favorite">
          <div id="myfavart_banner"></div>
          <table width="190" border="1">
		  {% for f in myfavoriteillustration %}    <!--Loop to display favorite illustration-->
            <tr>
              <td width="122"><a href="{{f.title}}"> {{f.title}}</td>
			  {% if edit %}
              <td width="52"><form id="form8" name="form8" method="post" action="">
                <label>
                  <input type="submit" name="button9" id="button9" value="Delete" />  <!--Buton to delete favorite illustration-->
                </label>
              </form></td>
			  {% endif %}
            </tr>
			{% endfor %}
			
            
          </table>
        </div>

      </div>
   
 <!--Data that is displayed in middle of profile-->
 <div id="maincontent_in_profile"> 

        <div id="block_profile">
             <div id="block_title_myfriend"> 
                 <div id="block_title_area1">
                 
				 </div>
                 <div id="block_title_area2">
                   <form id="form13" name="form13" method="post" action="">
                     <label>
                       <a href="../list/{{user}}-friends/1"><input type="button" name="button14" id="button14" value="Show More" /></a>     <!--Button to show more friends-->
                     </label>
                   </form>
                 </div>
            </div>
             <div id="block_content">
			 {% for f in friends %}         <!--Display friends in profile-->
					<div id="small_block">
					<a href="{{f.user}}"> <img src="../profile_pic/{{f.user}}.jpg" alt="{{f.user}}'s Profile" style="height:100px;width:135px"/><br>{{f.user}} </a> <!--Show profile pic of friend-->
					</div>
			{% endfor %}
             </div>
        </div>
       <div id="block_profile">
                    <div id="block_title_myclan">
                       <div id="block_title_area1"> </div>
                       <div id="block_title_area2">
                         <form id="form14" name="form14" method="post" action="">
                           <label>
                             <a href="../list/{{user}}-clans/1"><input type="button" name="button14" id="button14" value="Show More" /></a>  <!--Button to show more clans-->
                           </label>
                         </form>
                       </div>
            </div>
             <div id="block_content">
			 {% for f in myclans %}                                  <!--Display clans in profile page-->
					<div id="small_block">
					<a href="../clan/{{f.clan}}"> <img src="../clanpics/{{f.clan}}.jpg" alt="{{f.clan}} Clan" style="height:100px;width:135px"/><br>{{f.clan}} </a> <!--SHow clan picture on page-->
					</div>
			{% endfor %}
             </div>
        </div>
         <div id="block_profile">
                      <div id="block_title_mycomics"> 
                      
                                      <div id="block_title_area1">
               
                </div>
                 <div id="block_title_area2">
				{% if edit %}
                 <a href="../upload">    <input type="submit" name="button12" id="button12" value="Upload" /></a>        <!--Button to upload Fictions-->
				 {% endif %}
				 <a href="../list/{{user}}-myfiction/1"><input type="button" name="button13" id="button13" value="Show More" /></a>
                </div>
             </div>
             <div id="block_content">
			 {% for f in mycomics %}                               <!--Display comics in profile-->
					<div id="small_block">
					<a href="../comics/{{f.comic.title}}"><img src="{{f.comic.path}}" style="width:100px;height:100px"/></a><br><strong>{{f.comic.title}}</strong>
					</div>
			{% endfor %}
             </div>
        </div>
         <div id="block_profile">
         <div id="block_title_myfiction">
                                          <div id="block_title_area1">
                
                </div>
                 <div id="block_title_area2">
				{% if edit %}
                 <a href="../upload">    <input type="submit" name="button12" id="button12" value="Upload" /></a>        <!--Button to upload Fictions-->
				 {% endif %}
				 <a href="../list/{{user}}-myfiction/1"><input type="button" name="button13" id="button13" value="Show More" /></a>
                </div>
             </div>
             <div id="block_content">
			 {% for f in myfictions %}    <!--Display fictions in profile-->
					<div id="small_block" style="background:white">
					<a href="../fiction/{{f.work.title}}"><strong>{{f.work.title}}</a></strong><br>{{f.work.abstract}}   
					</div>
			{% endfor %}
             </div>
        </div>
         <div id="block_profile">
                               <div id="block_title_myart"> 
                                      <div id="block_title_area1">
               
                </div>
                <div id="block_title_area2">
				{% if edit %}
                 <a href="../upload">    <input type="submit" name="button12" id="button12" value="Upload" /></a>   <!--Button to upload illustrations-->
				 {% endif %}
				 <a href="../list/{{user}}-illustrations/1"><input type="button" name="button13" id="button13" value="Show More" /></a>  <!--Button to show more illustrations-->
                </div>
             </div>
             <div id="block_content">
			 {% for f in myillustrations %}     <!--Displayillustrations in profile-->
					<div id="small_block">
					<a href="../illustration/{{f.art.title}}"><img src="{{f.art.path}}" style="width:100px;height:100px"/></a><br><strong>{{f.art.title}}</strong>
					</div>
			{% endfor %}
             </div>
        </div>
      </div>
    </div>
    </div>
     <div id="comment">
      <form id="form4" name="form4" method="post" action="{{user}}/comment">     <!--Form to add a comment from a specific user-->
        <label>
          <form action="">
  			<input type="text" name="comment" value="Make Comments here"  onfocus="this.value=''" style="width: 964px; height: 125px"/>
			<input type="submit" name="button3" id="button3" value="Submit" />
			</form>
        </label>
      </form>
      <div id="comments_banner"></div>
	  {% for f in comments %}   <!--Display a list of comments added to the page-->
      	&nbsp &nbsp <a href="{{f.poster}}">{{f.poster}}</a>&nbsp- {{f.userComment}}<br>
		{% endfor %}
      </p>
    </div>
    <div id="footer_container">footer_container
    </div>
  </div>
</div>
</body>
</html>

